package org.raymond.icloud.common.starter.autoconfiguration;

import com.baomidou.mybatisplus.core.toolkit.Sequence;
import io.undertow.UndertowOptions;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Slf4j
@Configuration
public class BaseConfiguration {
    @Bean
    public UndertowServletWebServerFactory undertowServletWebServerFactory(){
        UndertowServletWebServerFactory factory = new UndertowServletWebServerFactory();
        factory.addBuilderCustomizers(builder -> builder.setServerOption(UndertowOptions.ENABLE_HTTP2, true));
        log.info("开启http2");
        return factory;
    }

    @Bean
    public Sequence sequence(){
        return new Sequence(null);
    }
}
